<style>
    .jqplot-highlighter-tooltip {
        
    }
 
  .listing-simple  h4{
        font-size: 24px;
        font-weight: bold;
        font-family: Arial,Helvetica,sans-serif;
        margin: 0 0 6px;
        
        
    }
     .listing-simple li{
        font-size: 13px;
        font-weight: bold;
        font-family: Arial,Helvetica,sans-serif;
        margin: 0 0 6px;
        line-height: 16px;
        
        
    }
    ul.tag-ul {
margin:5px 0 0;
padding:0;
}
ul.tag-ul li {
margin:2px;
list-style:none;
float:left;
}
ul.tag-ul li a {
margin:0px;
list-style:none;
float:left;
background:#ebebeb;
text-decoration:none;
color:#000;
border-radius:4px;
font-size:12px;
font-family:Calibri;
border:1px solid #bbbbbb;
padding:4px 6px;
}
ul.tag-ul li a:hover {
background:#144d7b;
border:1px solid #103454;
color:#fff;
}
</style>

<div id="fb-root"></div>
<script>(function(d, s, id) {
    var js, fjs = d.getElementsByTagName(s)[0];
    if (d.getElementById(id)) {return;}
    js = d.createElement(s); js.id = id;
    js.src = "//connect.facebook.net/en_US/all.js#xfbml=1";
    fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>

<?php 
echo $javascript->link(array('autocomplete/jquery.tokeninput'));
echo $this->Html->css(array('autocomplete/front_adjectives/token-input-rtu'));
?>

<div class="inner-container" style="color:#000;">
<?php //debug($tagsubjects); ?>
    

    <div class="container">
                                        <ul class="listing-simple"><h4>100 RANDOM SUBJECTS</h4>
                                            <?php 
                                            foreach ($tag_chain as $tag) { 
                                                if($tag['Tag']['level']<2){
                                                    continue;
                                                }
                                                ?>
                                                <li><?php echo $this->Html->link($tag['Tag']['title'],array('controller'=>'Subjects','action'=>'tags',$tag['Tag']['id']));  ?></li>
                                        <?php } ?>
                                        </ul>

                                        <div class="clear"></div>

    <div>
        <ul class="tag-ul" >
            <?php foreach($tagsubjects as $subject){ ?>
            <li><?php echo  $this->Html->link($subject['Subject']['subject'],array('controller'=>'Subjects','action'=>'subject',$subject['Subject']['id']));?></li>
            <!-- <li><?php echo  $this->Html->link($subject['Subject']['subject'],array('controller'=>'Subjects','action'=>'../subject',$subject['Subject']['subject']));?></li> -->
            <?php } ?>
        </ul>
    </div><div class="clear"></div>
                                        <div style="position: relative;">
                    <div class="like-text" style="position:absolute;width: 500px;margin: 18px 107px 0 0;">
                        <h1 id="h1" original-title="Title" style="position:absolute;right:50px;">How Much do You Like</h1>
                        <div class="ques" style="position: absolute;right:20px;"> <?php echo $this->Html->image('front/ques.png', array('alt' => 'SKIP', 'title' => 'skip')); ?></div>
                        
                        <div class="rating-points"></div>
                    </div>
                    <div class="meter-area" style="margin: 10px 0 0 0;background: none;background-color: #0B4557;border-radius:6px; ">
                        <div id="slider">
                                    <?php foreach ($subjects as $subject) { ?>
                                <div>
                                    <div class="image-display">
                                        <?php
                                        $thumbnail = $this->PhpThumb->generate(
                                                array(
                                                    'save_path' => WWW_ROOT . 'img/uploads/Subjects/thumbs',
                                                    'display_path' => 'uploads/Subjects/thumbs',
                                                    'error_image_path' => 'error.png',
                                                    'src' => WWW_ROOT . "img/uploads/Subjects/" . $subject['Subject']['image'],
                                                    'w' => 207,
                                                    'h' => 192,
                                                    'q' => 70,
                                                    'zc' => 1
                                                )
                                        );
                                        echo $this->Html->image($thumbnail['src'], array('width' => $thumbnail['w'], 'height' => $thumbnail['h'], 'title' => $subject['Subject']['subject'], 'alt' => $subject['Subject']['subject']));
                                        ?></div>
                                    <div class="meter-right">
                                        <div class="txt">
                                            <h2 ><?php
                                        echo str_replace('_', ' ', $subject['Subject']['subject']);
                                        if (!empty($subject['Subject']['desc'])) {
                                            echo " (" . $subject['Subject']['desc'] . ")";
                                        }
                                        ?>
                                            </h2>
                                            <div class="meter-div">
                                                <!-- Slider -->

                                                <div class="slider-range-min" id="<?php __($subject['Subject']['id']) ?>" name="<?php __(str_replace('_', ' ', $subject['Subject']['subject'])); ?>" imagename="<?php echo $subject['Subject']['image']; ?>"> </div>
                                            </div>
                                        </div>
                                    </div>
                                </div>
<?php } ?>
                        </div>
                    </div>    <input type="hidden" id="amount" value="" style="border:0; color:#f6931f; font-weight:bold;" />
                </div>
                                        <div class="subject" style="background:url('../../img/front/subject-grey-bg.png') no-repeat scroll center top transparent;">
        <h3>Rate a Different Subject</h3>
        <?php
        echo $this->Form->create('Subject');
        echo $this->Form->input('Subject.name', array('label' => '', 'value' => 'Enter here','id'=>'inputString','autocomplete'=>'off','onkeyup'=>'lookup1(this.value)','onclick'=>'this.value=""'));
        echo $this->Form->end(array('label'=>'','style'=>'display:none;'));
        ?>

    </div>
</div>
</div>


<div id="suggestions1"></div>


<script language='javascript'>


//    $(document).ready(function(){
//        var line1=<?php echo $history; ?>;
//    
//    var plot1 = $.jqplot('chartdiv', [line1], { 
//      title:'Voting History',
//      series: [{ 
//          label: 'Voting History', 
//          neighborThreshold: -1 
//      }], 
//      axes: { 
//          xaxis: { 
//              renderer: $.jqplot.DateAxisRenderer,
//              
//              tickOptions:{
//             
//            formatString:'%b&nbsp;%#d&nbsp;%Y',
//            mark: 'outside'
//            } 
//          }, 
//          yaxis: { 
//              min: 0,      // minimum numerical value of the axis.  Determined automatically.
//        max: 100,
//         ticks:[0,10,20,30,40,50,60,70,80,90,100]   
//          } 
//      }, 
//      cursor:{ 
//        show: true,
//        zoom:true, 
//        showTooltip:false
//      } 
//  });
// 
//  $('#button-reset').click(function() { plot1.resetZoom() });
//});
    
    
    
$(document).ready(function(){
    var base_url=$('#base-url').text();
    $("#popup-fields").fancybox({
		'titleShow'     : false,
		'transitionIn'	: 'elastic',
		'transitionOut'	: 'elastic',
		'easingIn'      : 'easeOutBack',
		'easingOut'     : 'easeInBack',
                'href'          :'#add-data'
            });
           
     $('#ProfileProfileEditForm').submit(function(){
         
     });
    var line1=<?php echo $history; ?>;
<?php if ($access->isLoggedIn() && !$can_rate) { ?>
                var plot1 = $.jqplot('chartdiv', [line1], {
          
                    title:'Voting History',
                    axes:{
                        xaxis:{
                            pad:0.5,
                            renderer:$.jqplot.DateAxisRenderer,
               
                            tickOptions:{
                                show: true,
                                showMark: true,
                                 showGridline: true,
                                 
                                formatString:'%b&nbsp;%#d&nbsp;%Y',
                                mark: 'cross'
                
                            }
                        },
                        yaxis:{
                            min: 0,      // minimum numerical value of the axis.  Determined automatically.
                            max: 100,
                            padMax:1.3,
                            ticks:[0,10,20,30,40,50,60,70,80,90,100]   ,
                            tickOptions:{
                                 showMark: true,
                                 showGridline: true,
                                formatString:''
                            }
                        }
                    },highlighter: {
        show: true,
        sizeAdjust: 7.5
      },
                    seriesDefaults:{
                       
              show: true,         // show the trend line
            color: '#1A5588',
                        lineWidth:5,
                        shadow:true,
                        shadowAngle:45,
                        shadowOffset:1
                         
                    },
                    axesDefaults:{
                        base:10,pad: 12
                    }
                });
<?php } ?>
            $('#show-tag').click(function (){
               
                $('#tags').slideToggle(500);
            });
            $('#more_adj').click(function(){
                $('#top-rank-div').fadeIn(900);
                $('#more_adj').css('display','none');
                $('#less_adj').css('display','block');
      
            }); 
            $('#less_adj').click(function(){
                $('#top-rank-div').fadeOut(900);
                $('#less_adj').css('display','none');
                $('#more_adj').css('display','block');
      
            });
            
            $('#show-demo').click(function(){
                $('#demograph-td').slideToggle(400);
            });

            $('#rate_now').fancybox({
                'transitionIn'	:	'elastic',
                'transitionOut'	:	'elastic',
                'speedIn'		:	600, 
                'speedOut'		:	200, 
                'overlayShow'	:	true,
                'href'          :  "<?php if ($access->isLoggedIn()) {
    echo "#rating";
} else {
    echo "#login_register";
} ?>",
                'onStart'       :function(){
            
                    $( "#rated_subject" ).val($('#rate_now').attr('name'));
                    $( "#subjectname" ).html($('.content-arae h1').html());
                
                    $.ajax({
                        url:base_url+'/Subjects/generatepopupimage',
                        type:'POST',
                        data:{subject: $("#rated_subject" ).val()},
                        success:function(response){
                            $('#subjectpopupimage').html(response);
                        }
                    });
                },
                'onClosed':function(){
                    $( "#small-slider-range-min" ).slider({value:0});
                    $( ".slider-range-min" ).slider({value:0});
                    $( "#amount" ).attr('value','0');
                    $( "#small-amount" ).attr('value','0');
                   
                }
                //            'onClosed'      :function(){
                //                if($('#adjective1').tokenInput("get").length !='0' || $('#adjective2').tokenInput("get").length !='0'  || $('#adjective3').tokenInput("get").length != '0'){
                //                $('#adjective1').tokenInput("clear").blur();
                //                   $('#adjective2').tokenInput("clear").blur();
                //                      $('#adjective3').tokenInput("clear").blur();
                //                }
                //            }
                //            
                
                
            });
<?php if (!$access->isLoggedIn()) { ?>
        $('#commentBox').focus(function(){
            $('#login_register form').attr('id','loginOnly');
            //alert($('#login_register form').attr('id'));
            $.fancybox({
                'transitionIn'	:	'elastic',
                'transitionOut'	:	'elastic',
                'speedIn'		:	600, 
                'speedOut'		:	200, 
                'overlayShow'	:	true,
                'href'          :  "#login_register"
            }
        );
            $('#loginOnly').live('submit',function(){
                if($('#username').val()==''){
                    $('#username').attr('title','Enter Username');
                    $('#login-error-box').fadeIn(200).html('Enter Your Email').delay(5000).fadeOut(500);;
                    return false;
                }else if($('#password').val()==''){
                        
                    $('#login-error-box').fadeIn(200).html('Enter Password').delay(5000).fadeOut(500);
                    return false;
                }
                if($("#remember_login:checked").length>0){
          var r=1;
       }else{
           r=0;
       }
                $.ajax({
                    url:base_url+'/Users/check_login' ,
                    type:'POST',
                    data:{username:$('#username').val(),password:$('#password').val(),remember:r},
                    success:function(res){
                        var response=$.parseJSON(res);
                        if(!response.error){
                            $('#login_register form').attr('id','login');
                            location.reload();
                        }else if (response.error){
                            if(response.type=="1"){
                                $("#login-error-box").css("display","block");
                                $("#login-error-box").html("It seems that You haven't verified your account yet.Please check your email for Verification email and then try again. <span style='font-weight:bold;cursor:pointer; font-size16px;color:#000;' name='"+response.email+"' id='varify_again'>Click Here </span> to resend verification email ");
                            }else if(response.type=="2"){
                                $("#login-error-box").css("display","block");
                                $("#login-error-box").html("login failed.Invalid username or password");
                            }
                        }
                            
                    }
                });
                return false; 
            });
        });
            
<?php } ?>

    $('#SubjectCommentForm').live('submit',function(){
        if ($('textarea#commentBox').val()==''){
            $('#commennterror').html('Type Something');
            return false;
        }
        return true;
    });
    /******************** Comment Votes***************************************/
    $('.vote').click(function(){
        var action=$(this).attr('type');
        $.ajax({
            url:base_url+'/Subjects/comment_vote',
            type:'POST',
            data:{type:$(this).attr('type'),id:$(this).attr('cid')},
            success:function(res,action){
                resp=$.parseJSON(res);
                if(resp.result=="true"){
                    $('#'+resp.cid).html(resp.html);
                    //$('ul #'+resp.cid).html('heklla');
                }
            }
        });
    });

    /********************/
    /************  Report comment  **************/
            
    $(".report").click(function (event){
        event.preventDefault();

        var id=$(this).attr('cid');
        $('#report-error').attr('cid',id);
        $.fancybox({
            'transitionIn'	:	'elastic',
            'transitionOut'	:	'elastic',
            'speedIn'		:	600, 
            'speedOut'		:	200, 
            'overlayShow'	:	true,
            'titleShow'     :false,
            'href':'#report-popup',
            'onClosed'		: function() {
                $("#error").hide();
            }
                
        });
    });
    $('#reportImage').live('submit',function(){
           
        if ($("#report_comment").val().length < 1){
           
            $("#report-error").show();
            $.fancybox.resize();
            return false;
        }
        
        $.ajax({
            url: base_url+"/Subjects/report_comment",
            type: "POST",
            data: {
                id : $('#report-error').attr('cid'),
                comment : $('#report_comment').val()
            },
            success: function(response){
                $.fancybox(response);
            }
        });
       
         
        return false;
        
    });
    /********************************************/
            
            
});

</script>
<script language="javascript" >
$(document).ready(function(){
    var base_url=$('#base-url').text(); // This will be used for all ajax calls as base url
    var rate_colors = ["#000032","#010166","#010096","#003399","#0066cb","#0199cb","#33cbcd","#00cc65","#65cc33","#329900","#66cc00","#99cc33","#ccff00","#e9e335","#ffcc00","#fe9900","#ff6600","#cd3304","#cd0102","#fe0000"];
    $('#slider').bxSlider({
        infiniteLoop: true,
        hideControlOnEnd: false,
        prevImage:base_url+'/img/front/back.png',
        nextImage:base_url+'/img/front/skip.png'
    });
    $('.skip').live('click',function(){
        $('#sliderD').bxSlider({
            infiniteLoop: false,
            hideControlOnEnd: true
        });
    });  
    $('.bx-next').bind('click',function(){
        $( "#amount" ).attr('value','0');
        $( "#small-amount" ).attr('value','0');
        $( ".small-rating" ).empty();
        $( ".slider-range-min" ).slider("value",'');
        $( ".rating-points" ).empty();
        //$(".ui-slider-handle" ).html('0');
        $('.ui-slider-handle').css('background-position','0px 0');
    });   
       
    $('.bx-prev').bind('click',function(){
        $( "#amount" ).attr('value','0');
        $( "#small-amount" ).attr('value','0');
        $( ".small-rating" ).empty();
        $( ".slider-range-min" ).slider("value",'');
        $( ".rating-points" ).empty();
        $('.ui-slider-handle').css('background-position','0px 0');
    });  
    // OPACITY OF BUTTON SET TO 50%
    $(".latest_img").css("opacity","0.3");
    // ON MOUSE OVER
    $(".latest_img").hover(function () {
										  
        // SET OPACITY TO 100%
        $(this).stop().animate({
            opacity: 1.0
        }, "slow");
    },
    // ON MOUSE OUT
    function () {
			
        // SET OPACITY BACK TO 50%
        $(this).stop().animate({
            opacity: 0.3
        }, 4000);
    });
    

    $( "#small-slider-range-min" ).slider({
        range: "min",
        value:0,
        min: 0,
        max: 100,
        slide: function( event, uii ) {
            $( ".small-rating" ).html(uii.value );
            $( "#amount" ).val(uii.value);
            $('#small-amount').val(uii.value);
            $( ".slider-range-min" ).slider({value:uii.value});
            $(uii.value).each(function(){
                var i=1;
                pindex=10;
                if(uii.value%5=='0' && uii.value!='100'){
                        
                    pindex=-(uii.value*4);
                    $('.ui-slider-handle').css('background-position',pindex+'px 0');
                    var pointer=Math.floor(uii.value/5);
                    $(".small-rating").css("color",rate_colors[pointer]);
                    i++;
                }
            });
        }
    });
                
       
		


    $( ".slider-range-min" ).slider({
        range: "min",
        value: 0,
        min: 0,
        max: 100,
        stop: function(event, ui) { 
            $( "#rated_subject" ).val($(this).attr('id'));
            $( "#subjectname" ).html("<a style='color:#0099BD;' href='"+base_url+"/Subjects/../subject/"+$(this).attr('name')+"'>"+$(this).attr('name')+"</a>");
            $( "#small-slider-range-min" ).slider({value:ui.value});
            $( ".small-rating" ).html(ui.value );
            $( "#amount" ).val(ui.value);
            $('#small-amount').val(ui.value);
            var pointer=Math.floor(ui.value/5);
                    
            $(".small-rating").css("color",rate_colors[pointer]);
            $(".ui-slider-handle").trigger('click');
            
                
        },
        start: function( event, ui ) {
            //                $( "#amount" ).val(ui.value );
            //                $( ".ui-slider-handle" ).html(ui.value );
            //                $( "#rated_subject" ).val($(this).attr('id'));
            //                $( "#subjectname" ).html($(this).attr('name'));
            //                $( "#small-slider-range-min" ).slider({value:ui.value});
        },
        //            slide: function( event, ui ) {
        //               
        //                $( "#amount" ).val(ui.value );
        //                $( ".ui-slider-handle" ).html(ui.value );
        //                $( "#rated_subject" ).val($(this).attr('id'));
        //                $( "#subjectname" ).html($(this).attr('name'));
        //                $( "#small-slider-range-min" ).slider({value:ui.value});
        //                //$(ui.value).each(function(){
        //                     pindex=10
        //                    if(ui.value%5=='0' && ui.value!='100'){
        //                        pindex=-(ui.value*4);
        //                        //alert(ui.value);
        //                         $('.ui-slider-handle').css('background-position',pindex+'px 0');
        //                        
        //                    }
        //                    
        //               // });
        //            },
        change: function( event, ui ) {
               
                
            $( ".rating-points" ).text(ui.value );
            if(ui.value%5=='0' && ui.value!='100'){
                var   pindex=-(ui.value*4);
                $('.ui-slider-handle').css('background-position',pindex+'px 0');
            }
            var pointer=Math.floor(ui.value/5);
            $(".rating-points").css("color",rate_colors[pointer]);
        }
    });
    /*        ui-slider-range */
    $(".slider-range-min").mousemove(function(e){
        //        alert($(this).width());
        //        alert($(this).position().left);
        var w = $(this).width();
        var n = e.pageX;
        var s = $(this).offset().left;
        var a = n-s;
        var v = Math.floor(a/w*100);
        $( ".slider-range-min" ).slider("value",v);
    });
         
    $('.slider-range-min .ui-slider-handle').fancybox({
        'transitionIn'	:	'elastic',
        'transitionOut'	:	'elastic',
        'speedIn'		:	600, 
        'speedOut'		:	200, 
        'overlayShow'	:	true,
        'href'          :  "<?php if ($access->isLoggedIn()) {
    echo "#rating";
} else {
    echo "#login_register";
} ?>",
        'onStart'       :function(){
            //alert($('#'+$('#rated_subject').val()).attr('name'));
            $.ajax({
                url:base_url+'/Subjects/generatepopupimage',
                type:'POST',
                 data:{subject: $("#rated_subject" ).val()},
                success:function(response){
                    $('#subjectpopupimage').html(response);
                }
            });
        }
        //            'onClosed'      :function(){
        //                if($('#adjective1').tokenInput("get").length !='0' || $('#adjective2').tokenInput("get").length !='0'  || $('#adjective3').tokenInput("get").length != '0'){
        //                $('#adjective1').tokenInput("clear").blur();
        //                   $('#adjective2').tokenInput("clear").blur();
        //                      $('#adjective3').tokenInput("clear").blur();
        //                }
        //            }
        //            
                
                
    });
    /*********************** Autocomplete for Adjectives ************************/
        
           
        
    /*********************** Autocomplete for Adjectives Ends ************************/
        
    /*******************Login from popup   *************************/
    $('#login').live('submit',function(){
        if($('#username').val()==''){
            $('#username').attr('title','Enter Username');
            $('#login-error-box').fadeIn(200).html('Enter Your Email').delay(5000).fadeOut(500);;
            return false;
        }else if($('#password').val()==''){
                
            $('#login-error-box').fadeIn(200).html('Enter Password').delay(5000).fadeOut(500);
            return false;
        }
        if($("#remember_login:checked").length>0){
          var r=1;
        }else{
           r=0;
        }
        $.ajax({
            url:base_url+'/Users/check_login' ,
            type:'POST',
            data:{username:$('#username').val(),password:$('#password').val(),remember:r},
            success:function(res){
                var response=$.parseJSON(res);
                if(!response.error){
                    $('#login_element').load(base_url+'/Subjects/login_element');
                    $('#login_register').attr('id','rating');
                    $('#rating').attr('id','login_register');
                    //$('#SubjectRateForm').post();
                    //$('#SubjectRateForm').trigger('submit');
                    $('.slider-range-min .ui-slider-handle').trigger('click');
                }else if (response.error){
                    if(response.type=="1"){
                        $("#login-error-box").css("display","block");
                        $("#login-error-box").html("It seems that You haven't verified your account yet.Please check your email for Verification email and then try again. <span style='font-weight:bold;cursor:pointer; font-size16px;color:#000;' name='"+response.email+"' id='varify_again'>Click Here </span> to resend verification email ");
                    }else if(response.type=="2"){
                        $("#login-error-box").css("display","block");
                        $("#login-error-box").html("login failed.Invalid username or password");
                    }
                   
                }
            }
        });
        return false; 
    });
    $('#SubjectRateForm').live('submit',function(){
        
        if($('#small-amount').val()=='0'){
            var cnfrm=confirm('Do you want to rate this subject  0 ?');
        }
        if($('#small-amount').val()!='0' || cnfrm){
            $.ajax({
                url:base_url+'/Subjects/rate',
                type:'POST',
                data:{subject_id:$('#rated_subject').val(),rating:$('#amount').val(),adj1:$('#adjective1').val(),adj2:$('#adjective2').val(),adj3:$('#adjective3').val()},
                success:function(response){
                    var result= $.parseJSON(response);
                
                    //  $.split(response);
                    if(result.error){
                        if(!result.login){
                            $('#login_register').attr('id','rating');
                            $('#rating').attr('id','login_register');
                            $('.slider-range-min .ui-slider-handle').fancybox({href:'#login_register'});
                            //alert($('#login_register').attr('id'));alert($('#rating').attr('id'));
                            $('.slider-range-min .ui-slider-handle').trigger('click');
                        }else if(!result.canRate){
                            //alert('You Cant rate a Subject within seven days.');//
                        
                            var data='<div class="register-form" style="padding:30px 0 30px 30px;font-size:16px; font-weight:bold;">You Cant rate a Subject Twice within seven days.</div>';
                        
                            $.fancybox(data);
                            //$.alert('You Cant rate a Subject within seven days.');
                        }
                    }else{
                        window.location=base_url+'/Subjects/subject/'+result.subjectID;
                    }
                
                
                }
            });}
        return false;
    });
        
        
    /**************************/
    $('#register-button').click(function(){
        $.fancybox.close();
        $('#open').trigger('click');
        $('html, body').animate({scrollTop:0}, 'slow');
            
    });
    /**************************/
        
        
        
    $('#adjective1').tokenInput(base_url+"/Subjects/adjectives",{ theme: "rtu",hintText: "Type in a search term",tokenLimit:'1'});
    $('#adjective2').tokenInput(base_url+"/Subjects/adjectives",{hintText: "Type in a search term", theme: "rtu",tokenLimit:'1'});
    $('#adjective3').tokenInput(base_url+"/Subjects/adjectives",{hintText: "Type in a search term", theme: "rtu",tokenLimit:'1'});   
                    
}
);
//function to slide 

</script>
<div id="popup_container" style="display:none">

    <div id="rating" class="rate">
<?php
echo $this->Form->create('Subject', array('action' => 'rate'));
echo $this->Form->input('id', array('type' => 'hidden', 'id' => 'rated_subject'))
?>    

        <table cellspacing="0" cellpadding="0" border="0" >
            <tbody>
                <tr>
                    <td colspan="2"><h2>RATE <span id="subjectname" style="color:#4BB2C5"></span></h2></td>
                </tr>
                <tr>
                    <td width="22%">
                        <div id="subjectpopupimage"></div>
                    </td>
                    <td width="78%">
                        <div class="meter-div1">
                            <!-- Slider -->


                            <div class="small-rating"></div>
                            <div id="small-slider-range-min"> </div>
                        </div><input type="hidden" id="small-amount" value="0" style="border:0; color:#f6931f; font-weight:bold;" /></td>
                </tr>
                <tr>
                    <td colspan="2"><h3>Add One, Two, or Three Adjectives (optional)</h3></td>
                </tr>
                <tr>
                    <td colspan="2"><?php echo $this->Form->input('adjective1', array('label' => '', 'id' => 'adjective1', 'type' => 'text', 'title' => 'Adjective', 'class' => 'input2')) ?></td>

                </tr>
                <tr>
                    <td colspan="2"><?php echo $this->Form->input('adjective2', array('label' => '', 'id' => 'adjective2', 'type' => 'text', 'title' => 'Adjective', 'class' => 'input2')) ?></td>
                </tr>
                <tr>
                    <td colspan="2"><?php echo $this->Form->input('adjective3', array('label' => '', 'id' => 'adjective3', 'type' => 'text', 'title' => 'Adjective', 'class' => 'input2')) ?></td>
                </tr>
                <tr>
                    <td  colspan="2" ><?php echo $this->Form->end(array('label' => '', 'class' => 'submit-btn')); ?></td>
                </tr>
            </tbody>
        </table>

    </div>

    <div id="login_register" class="register-form">
<?php echo $this->Form->create('User', array('action' => 'check_login', 'id' => 'login')); ?>
        <table cellspacing="0" cellpadding="0" border="0" >
            <tbody>
                <tr><td colspan="2"><div style="background: #C93A2A; color: #fff;padding:10px;font-size:13px; margin-bottom: 10px;">Sorry, you can't rate something until you sign up or login
                        </div></td></tr>
                <tr>
                    <td colspan="2"><h2>Login  or <span id="register-button">Sign Up</span></h2></td>
                </tr>
                <tr>
                    <td width="30%"><label class="label1">Email/username</label></td>
                    <td width="70%"><?php echo $this->Form->input('username', array('label' => '', 'id' => 'username', 'class' => 'input2', 'title' => 'Your Login email')); ?></td>
                </tr>
                <tr>
                    <td><label label1>Password</label></td>
                    <td><?php echo $this->Form->input('password', array('label' => '', 'id' => 'password', 'class' => 'input2', 'title' => 'Password')) ?></td>
                </tr>
                 <tr>
                     <td><label label1>Remember me:</label></td>
                     <td><?php echo $this->Form->input('remember', array('label' => '', 'id' => 'remember_login', 'type' => 'checkbox', 'class' => 'field',  'title' => 'Remember me.')); ?></td>
                 </tr>
                <tr>
                    <td colspan="2"><div id="login-error-box" style="color:#f00;">
                        </div>
                    </td></tr>

                <tr>
                    <td>&nbsp;</td>
                </tr>
                <tr>
                    <td>&nbsp;</td>
                    <td ><?php echo $this->Form->end(array('label' => '', 'class' => 'login-btn', 'title' => 'Login')) ?> or <div class="fb-login-button" data-perms="email" style="width:300px">Login with Facebook</div></td>
                </tr>
            </tbody>
        </table>
        </form>
    </div>

    <div id="report-popup" class="register-form">
        <div id="report-error" style="background: none repeat scroll 0 0 red;
             color: #C93A2A;
             display: none; line-height: 20px;padding: 5px;">Please type something </div>
<?php
echo $this->Form->create('Subject', array('id' => 'reportImage'));
echo $this->Form->input('report', array('label' => '<span style="font-size:18px">Leave a comment</span>', 'type' => 'textarea', 'id' => 'report_comment', 'rows' => '10', 'cols' => '45'));
echo $this->Form->end(array('label' => '', 'style' => 'background:url("/ratetheu/img/front/report-btn.png");width:69px;height:20px;border:none;cursor:pointer;'));
?>
    </div>


</div>
